package io.github.lee.repository.qb.repository

import io.github.lee.repository.qb.dao.SessionDao
import io.github.lee.repository.qb.data.QbSession
import io.github.lee.repository.qb.di.http.HttpModule
import javax.inject.Inject

class SessionRepository @Inject constructor(
    private val dao: SessionDao
) : BaseRepository() {


    suspend fun saveSession(session: QbSession): QbSession {
        val result = dao.insert(session)
        session.id = result
        return session
    }

    suspend fun queryCurrent(): QbSession? {
        return dao.queryLast()
    }

}